#ifndef __NETDEV_AUTO_SELECT_H__
#define __NETDEV_AUTO_SELECT_H__
#define NETDEV_NAME_LEN_MAX 8
// 3s
#define NETDEV_LOAD_WAIT_TIME 3000
#define WIFI_LOAD_WAIT_TIME 10000
// 20s
#define PPP_LOAD_WAIT_TIME 20000

typedef enum
{
    GATEWAY_WIFI_CONNECT,
    GATEWAY_NET_RESELECT,
} manager_net_e;

#define NETDEV_TEST_HOST "www.baidu.com"
#define NETDEV_TEST_HOST_1 "www.baidu.com"
#define NETDEV_TEST_HOST_2 "www.taobao.com"
#define NETDEV_TEST_HOST_3 "www.apple.com"

int netdev_get_index_by_netdev(void *netdev);
int netdev_set_net_status(int index, unsigned int status);

int netdev_set_status_changed_callback(void *callback);

/**
 * @brief reset total net system
 *
 * @return none
 */
int netdev_reselect_policy(manager_net_e event);

int wifi_on_func(char *name);

int cat1_on_func(char *name);

int wifi_off_func(char *name);

int cat1_off_func(char *name);

int netdev_set_policy(char *name);

void netdev_enable_dhcp(char *netdev_name, unsigned char enable);

void update_net_if_info(void);

void update_wifi_info(void);

void update_cat1_info(void);

void netdev_update_info(void);

int netdev_set_static_ip(char *netdev_name, char ip_addr[16], char gateway_addr[16], char mask_addr[16], char p_dns[16], char s_dns[16]);

int netdev_set_default_ip(void);

int netdev_set_macaddr(char *netdev_name, char *mac);

// int netdev_manager_set_mac(void);

#endif // __NETDEV_AUTO_SELECT_H__
